package com.kaili.basic.service.impl;

import com.baomidou.mybatisplus.plugins.Page;
import com.baomidou.mybatisplus.service.impl.ServiceImpl;
import com.kaili.basic.mapper.BaseStoreHouseMapper;
import com.kaili.basic.pojo.dto.BaseStoreHouseQueryDto;
import com.kaili.basic.pojo.entity.BaseStoreHouseEntity;
import com.kaili.basic.pojo.vo.BaseStoreHouseLikeVO;
import com.kaili.basic.pojo.vo.BaseStoreHouseVO;
import com.kaili.basic.service.BaseStoreHouseService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

@Service
public class BaseStoreHouseServiceImpl extends ServiceImpl<BaseStoreHouseMapper, BaseStoreHouseEntity> implements BaseStoreHouseService {
    @Autowired
    private BaseStoreHouseMapper baseStoreHouseMapper;
    @Override
    public Page<BaseStoreHouseEntity> queryPageList(Page<BaseStoreHouseEntity> page, BaseStoreHouseQueryDto queryDto) {
        page.setRecords(baseStoreHouseMapper.queryPageList(page,queryDto));
        return page;
    }

    @Override
    public Long queryStoreCoude() {
        return baseStoreHouseMapper.queryStoreCoude();
    }

    @Override
    public void updateDefaultStore(Map<String,Object> map) {
        baseStoreHouseMapper.updateDefaultStore(map);
    }

    @Override
    public List<BaseStoreHouseLikeVO> queryAllStoreHouse() {
        return baseStoreHouseMapper.queryAllStoreHouse();
    }

    @Override
    public List<BaseStoreHouseVO> export(BaseStoreHouseQueryDto queryDto) {
        return baseStoreHouseMapper.storeHousesExport(queryDto);
    }
}
